import service from '@/utils/request'

export const useSsCarApi = (id: number) => {
	return service.get('/ss/car/' + id)
}

export const useSsCarSubmitApi = (dataForm: any) => {
	if (dataForm.id) {
		return service.put('/ss/car', dataForm)
	} else {
		return service.post('/ss/car', dataForm)
	}
}


export const getCarListApi = (dataForm: any) => {
		return service.post('/ss/car/list', dataForm)
}

export const changeScenicApi = (data: { id: string|number, scenicId: string|number }) => {
    return service.post('/ss/car/change-scenic', data)
  }
  // 设置车辆状态
  export const setCarStatusApi = (data: { id: string|number, carStatus: number }) => {
    return service.post('/ss/car/set-status', data)
  }
  // 设置运行状态
  export const setRunStatusApi = (data: { carId: string|number, carStatus: number }) => {
    return service.post('/ss/car/set-run-status', data)
  }
  // 车辆开锁
  export const unlockCarApi = (carId: string|number) => {
    return service.post(`/ss/car/unlock/${carId}`)
  }
  // 车辆鸣笛
  export const hornCarApi = (carId: string|number) => {
    return service.post(`/ss/car/horn/${carId}`)
  }



